<?php
define('SW_',true);
define('SW_PAGE_INSTALL',true);
require_once('_common.php');

//判断是否是非法请求
if(SW::$preAction!='install') die('Access Error');

//初始化安装类
$objInstall=new SWInstall();

//网页头属性
SWAdmin::$js=array('pages.install');
SWAdmin::$title=LANG('Install');
SWAdmin::$group='system';

require('_systemheader.php');
?>

<div id="system" style="margin:20px auto;">
		
	<form name="form1" id="step1">

		<div class="white_box ui-corner-all">
			<ul class="selectlist">
				<li class="selectindex ui-corner-top" style="border-top:0;">
					<div class="cell100"><strong><?php __(LANG('Site Setting'));?></strong></div>
					<div style="clear:both"></div>
				</li>
				<li class="selectitem">
					<div class="cell25"><?php __(LANG('Option_Title'));?></div>
					<div class="cell75"><input type="text" class="input_2" value="<?php __($objInstall->title);?>" name="title" style="width:200px;" /></div>
					<div style="clear:both"></div>
				</li>
				<li class="selectitem">
					<div class="cell25"><?php __(LANG('Option_Url'));?></div>
					<div class="cell75"><input type="text" class="input_2" value="<?php __($objInstall->url);?>" name="url" style="width:200px;" /></div>
					<div style="clear:both"></div>
				</li>
				<li class="selectitem">
					<div class="cell25"><?php __(LANG('Option_Description'));?></div>
					<div class="cell75"><input type="text" class="input_2" value="<?php __($objInstall->description);?>" name="description" style="width:200px;" /></div>
					<div style="clear:both"></div>
				</li>
				<li class="selectitem">
					<div class="cell25"><?php __(LANG('Option_Language'));?></div>
					<div class="cell75"><select name="language" style="width:200px;">
						<?php
						foreach(SWLanguage::getAllLanguages() as $value){
							__('<option value="'.$value.'" '.($objInstall->language==$value?'selected="selected"':'').'>'.$value.'</option>');
						}
						?>
					</select></div>
					<div style="clear:both"></div>
				</li>
				<li class="selectitem">
					<div class="cell25"><?php __(LANG('Option_Timezone'));?></div>
					<div class="cell75"><select name="timezone" style="width:200px;">
						<?php
						foreach(SWFunc::timezoneList() as $value){
							__('<option value="'.$value.'" '.($objInstall->timezone==$value?'selected="selected"':'').'>'.$value.'</option>');
						}
						?>
					</select></div>
					<div style="clear:both"></div>
				</li>
				<li class="selectindex">
					<div class="cell100"><strong><?php __(LANG('Account Setting'));?></strong></div>
					<div style="clear:both"></div>
				</li>
				<li class="selectitem">
					<div class="cell25"><?php __(LANG('Option_Author'));?></div>
					<div class="cell75"><input type="text" class="input_2" value="<?php __($objInstall->author);?>" name="author" style="width:200px;" /></div>
					<div style="clear:both"></div>
				</li>
				<li class="selectitem">
					<div class="cell25"><?php __(LANG('Option_Email'));?></div>
					<div class="cell75"><input type="text" class="input_2" value="<?php __($objInstall->email);?>" name="email" style="width:200px;" /></div>
					<div style="clear:both"></div>
				</li>
				<li class="selectitem">
					<div class="cell25"><?php __(LANG('Account'));?></div>
					<div class="cell75"><input type="text" class="input_2" value="<?php __($objInstall->account);?>" name="account" style="width:200px;" /></div>
					<div style="clear:both"></div>
				</li>
				<li class="selectitem">
					<div class="cell25"><?php __(LANG('Password'));?></div>
					<div class="cell75"><input type="password" class="input_2" value="" name="password" style="width:200px;" /></div>
					<div style="clear:both"></div>
				</li>
				<li class="selectitem">
					<div class="cell25"><?php __(LANG('Option_Repassword'));?></div>
					<div class="cell75"><input type="password" class="input_2" value="" name="repassword" style="width:200px;" /></div>
					<div style="clear:both"></div>
				</li>
				<li class="selectindex">
					<div class="cell100"><strong><?php __(LANG('Database Setting'));?></strong></div>
					<div style="clear:both"></div>
				</li>
				<li class="selectitem">
					<div class="cell25"><?php __(LANG('Setup_DB_Server'));?></div>
					<div class="cell75"><input type="text" class="input_2" value="<?php __($objInstall->dbhost);?>" name="dbhost" style="width:200px;" /></div>
					<div style="clear:both"></div>
				</li>
				<li class="selectitem">
					<div class="cell25"><?php __(LANG('Setup_DB_Database'));?></div>
					<div class="cell75"><input type="text" class="input_2" value="<?php __($objInstall->dbname);?>" name="dbname" style="width:200px;" /></div>
					<div style="clear:both"></div>
				</li>
				<li class="selectitem">
					<div class="cell25"><?php __(LANG('Setup_DB_Account'));?></div>
					<div class="cell75"><input type="text" class="input_2" value="<?php __($objInstall->dbuser);?>" name="dbuser" style="width:200px;" /></div>
					<div style="clear:both"></div>
				</li>
				<li class="selectitem">
					<div class="cell25"><?php __(LANG('Setup_DB_Password'));?></div>
					<div class="cell75"><input type="password" class="input_2" value="<?php __($objInstall->dbpass);?>" name="dbpass" style="width:200px;" /></div>
					<div style="clear:both"></div>
				</li>
				<li class="selectitem">
					<div class="cell25"><?php __(LANG('Setup_DB_Prefix'));?></div>
					<div class="cell75"><input type="text" class="input_2" value="<?php __($objInstall->dbprefix);?>" name="dbprefix" style="width:200px;" /></div>
					<div style="clear:both"></div>
				</li>
			</ul>
		</div>

		<div style="margin-top:10px;text-align:right;">
			<a href="javascript:void(0);" id="install" class="button"><?php __(LANG('Install'));?> &raquo;</a>
		</div>
	
	</form>

	<div class="white_box ui-corner-all" id="step2" style="display:none;">
		
		<div class="system_message">

			<h2><?php __(LANG('Install Succeed'));?></h2>
			<p>

				<a href="login.php"><?php __(LANG('Setup_Login_To_Admin'));?> &raquo;</a><br />
				<a href="../"><?php __(LANG('Setup_Back_To_Index'));?> &raquo;</a><br />
				<a href="http://www.svoo.org"><?php __(LANG('Setup_Go_To_Offical'));?> - http://www.svoo.org</a>

			</p>

		</div>

	</div>
	
</div>

<?php
require('_systemfooter.php');

?>
